<template>
  <div class="dashboard-container">
    <!-- <my-com @click.native="fn" /> -->
    <!-- <div @click="fn">123</div> -->
    <my-com-1 v-model="num" />
    上面的v-model等价于下面的写法
    <my-com-1
      :value="num"
      @input="val => num = val"
    />
    <hr>
    <my-com-2 :a.sync="num" :b.sync="age" />
  </div>
</template>

<script>
// import MyCom from './MyCom.vue'
import MyCom1 from './MyCom1.vue'
import MyCom2 from './MyCom2.vue'
import { mapGetters } from 'vuex'
export default {
  name: 'Dashboard',
  components: { MyCom1, MyCom2 },
  data() {
    return {
      num: 101,
      age: 18
    }
  },
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  methods: {
    fn() {
      alert(1)
    }
  }

}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
